package org.jivesoftware.smackx.provider;

import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smack.provider.PacketExtensionProvider;
import org.jivesoftware.smackx.packet.CapsExtension;
import org.xmlpull.v1.XmlPullParser;

public class CapsExtensionProvider
  implements PacketExtensionProvider
{
  public PacketExtension parseExtension(XmlPullParser paramXmlPullParser)
    throws Exception
  {
    int i = 0;
    String str1 = null;
    String str2 = null;
    String str3 = null;
    while (true)
    {
      while (true)
      {
        if (i != 0)
          return new CapsExtension(str3, str2, str1);
        if ((paramXmlPullParser.getEventType() == 2) && (paramXmlPullParser.getName().equalsIgnoreCase("c")))
        {
          str1 = paramXmlPullParser.getAttributeValue(null, "hash");
          str2 = paramXmlPullParser.getAttributeValue(null, "ver");
          str3 = paramXmlPullParser.getAttributeValue(null, "node");
        }
        if ((paramXmlPullParser.getEventType() != 3) || (!(paramXmlPullParser.getName().equalsIgnoreCase("c"))))
          break;
        i = 1;
      }
      paramXmlPullParser.next();
    }
  }
}